using System;
using System.Text;

namespace RealState.BusinessObjects
{
	[Serializable()]
	public class ContentTypes
	{
        private int _RowNum;

        public int RowNum
        {
            get { return _RowNum; }
            set { _RowNum = value; }
        }

		private int _ID;

		public int ID
		{
			get { return _ID; }
			set { _ID = value; }
		}

		private string _Title;

		public string Title
		{
			get { return _Title; }
			set { _Title = value; }
		}

		private int _GroupId;

		public int GroupId
		{
			get { return _GroupId; }
			set { _GroupId = value; }
		}

		public ContentTypes()
		{ }

		public ContentTypes(int ID,string Title,int GroupId)
		{
			this.ID = ID;
			this.Title = Title;
			this.GroupId = GroupId;
		}

		public override string ToString()
		{
			return "ID = " + ID.ToString() + ",Title = " + Title + ",GroupId = " + GroupId.ToString();
		}

		public class IDComparer : System.Collections.Generic.IComparer<ContentTypes>
		{
			public SorterMode SorterMode;
			public IDComparer()
			{ }
			public IDComparer(SorterMode SorterMode)
			{
				this.SorterMode = SorterMode;
			}
			#region IComparer<ContentTypes> Membres
			int System.Collections.Generic.IComparer<ContentTypes>.Compare(ContentTypes x, ContentTypes y)
			{
				if (SorterMode == SorterMode.Ascending)
				{
					return y.ID.CompareTo(x.ID);
				}
				else
				{
					return x.ID.CompareTo(y.ID);
				}
			}
			#endregion
		}
		public class TitleComparer : System.Collections.Generic.IComparer<ContentTypes>
		{
			public SorterMode SorterMode;
			public TitleComparer()
			{ }
			public TitleComparer(SorterMode SorterMode)
			{
				this.SorterMode = SorterMode;
			}
			#region IComparer<ContentTypes> Membres
			int System.Collections.Generic.IComparer<ContentTypes>.Compare(ContentTypes x, ContentTypes y)
			{
				if (SorterMode == SorterMode.Ascending)
				{
					return y.Title.CompareTo(x.Title);
				}
				else
				{
					return x.Title.CompareTo(y.Title);
				}
			}
			#endregion
		}
		public class GroupIdComparer : System.Collections.Generic.IComparer<ContentTypes>
		{
			public SorterMode SorterMode;
			public GroupIdComparer()
			{ }
			public GroupIdComparer(SorterMode SorterMode)
			{
				this.SorterMode = SorterMode;
			}
			#region IComparer<ContentTypes> Membres
			int System.Collections.Generic.IComparer<ContentTypes>.Compare(ContentTypes x, ContentTypes y)
			{
				if (SorterMode == SorterMode.Ascending)
				{
					return y.GroupId.CompareTo(x.GroupId);
				}
				else
				{
					return x.GroupId.CompareTo(y.GroupId);
				}
			}
			#endregion
		}
	}
}
